<template>
	<view class="item">
		<text class="label">{{label}}</text>
		
		<view v-if="!content" class="content-wrapper" @click="uniHistory.push(url)">
			<slot name="content"></slot>
			<image class="arrow" v-if="isLink" src="/static/imgs/icon_right_arrow.png" mode=""></image>
		</view>
		
		<view v-else class="content-wrapper" @click="uniHistory.push(url)">
			<text class="content">{{content}}</text>
			<image class="arrow" v-if="isLink" src="/static/imgs/icon_right_arrow.png" mode=""></image>
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"cl-desc-item",
		
		props: {
			content: {
				type: String,
			},
			label: {
				type: String,
			},
			isLink: {
				type: Boolean,
				default: false,
			},
			url: {
				type: String,
				default: ''
			}
		},
		
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss">
	.item {
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 56rpx;
		
		text {
			font-size: 28rpx;
			color: $u-main-color;
		}
		
		.label {
			color: $uni-text-color-muted;
			width: 166rpx;
		}
		
		.content-wrapper {
			flex: 1;
			display: flex;
			flex-direction: row;
			align-items: center;
			
			image.arrow {
				margin-top: 4rpx;
				margin-left: 10rpx;
				height: 24rpx;
				width: 18rpx;
			}
		}
	}
</style>
